package com.suprema.biomini;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.technofovea.hllib.HlTypeMapper;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 載入動態連結檔
 * @author Kent Yeh 
 */
public class SFR300Loader {

    protected static Logger logger = LoggerFactory.getLogger(SFR300Loader.class);
//    private static int winCaptionHeight = 0;

    /*public interface User32 extends StdCallLibrary {

        User32 INSTANCE = (User32) Native.loadLibrary("user32", User32.class);
        int SM_CYCAPTION = 4;

        int GetSystemMetrics(int index);
    }*/
    private static SFR300 instance = null;

    static {
        Map<String, Object> options = new HashMap<String, Object>();
        options.put(Library.OPTION_TYPE_MAPPER, new HlTypeMapper());
        instance = (SFR300) Native.loadLibrary("SFR300", SFR300.class, options);
    }

    /**
     * 動態連結之 Context
     * @return 動態連結之 Context
     */
    public static SFR300 getInstance() {
        return instance;
    }

    /**
     *  取得Win32 視窗標題列高度
     * @return 
     *
    public static int getWindowTitleHeight() {
        if (winCaptionHeight == 0) {
            winCaptionHeight = User32.INSTANCE.GetSystemMetrics(User32.SM_CYCAPTION);
            logger.debug("視窗標題列高:{}", winCaptionHeight);
        }
        return winCaptionHeight;
    }*/
}
